package com.books.mapper.hotrecommend;

import com.books.model.entity.hotrecommend.Digest;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author 饿熊的咆哮
 * @Date 2021/10/8 18:25
 * @Version 1.0
 */
@Mapper
public interface DigestMapper {
    @Select("select * from digest")
    List<Digest> findAll();

    @Select("select * from digest where classify=#{classify}")
    List<Digest> findByClassify(String classify);

    @Insert("insert into digest values(null,#{contents},#{classify})")
    void addDigest(Digest digest);

    @Delete("delete from digest where content_id=#{contentId}")
    void delByContentId(Integer contentId);
}
